<script setup lang="ts">
import { computed, ref } from 'vue'
import { ElInput } from 'element-plus'
import TextSort from '@/components/text-sort.vue'

const textarea = ref('')
const text = computed(() => {
  const textList = textarea.value.replace(/([，]|[。])/g, '$1§').split('§')
  textList.pop()
  return textList
})
</script>

<template>
  <ElInput
    type="textarea"
    v-model="textarea"
    placeholder="粘贴一段中文文本"
  ></ElInput>
  <TextSort :text="text"></TextSort>
</template>
